import Layout from '@g/layout'
import { RouteRecordRaw } from 'vue-router'


export default [
  {
    path: '/redirect',
    component: Layout,
    hidden: true,
    name: 'Redirect',
    children: [
      {
        path: '/redirect/:path(.*)',
        component: () => import('@/views/status-page/Redirect.vue')
      }
    ]
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('@/views/login/index.vue'),
    meta: { hidden: true }
  },
  {
    path: '/404',
    name: '404',
    component: () => import('@/views/status-page/404.vue'),
    meta: { hidden: true }
  },
  {
    path: '/401',
    name: '401',
    component: () => import('@/views/status-page/401.vue'),
    meta: { hidden: true }
  },
  {
    path: '/',
    component: Layout,
    redirect: '/home',
    name: 'Home',
    children: [
      {
        path: 'home',
        name: 'HomeMain',
        component: () => import('@/views/home/index.vue'),
        meta: { title: '首页', icon: 'HelpFilled' }
      }
    ]
  },
  {
    path: '/test222',
    component: Layout,
    name: 'Test222',
    children: [
      {
        path: '',
        name: 'test222Home',
        component: () => import('@/views/test2/index.vue'),
        meta: { title: '测试222', icon: 'Search', cacheToNames: ['testIndex'] }
      }
    ]
  },
  {
    path: '/test',
    component: Layout,
    name: 'Test',
    children: [
      {
        path: '',
        name: 'TestIndex',
        component: () => import('@/views/test/index.vue'),
        meta: { title: '测试', icon: 'Search' }
      }
    ]
  },
  {
    path: '/test2',
    component: Layout,
    name: 'Test2',
    meta: { title: '测试二', icon: 'Search' },
    children: [
      {
        path: '', name: 'Test2Index1', component: () => import('@/views/test/index.vue'),
        meta: { title: 'test21', keepAlive: true }
      },
      {
        path: 'index2', name: 'Test2Index2', component: () => import('@/views/test/Test1.vue'),
        meta: { title: 'test22' }
      }
    ]
  }
] as RouteRecordRaw[]